package elvira;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.jdesktop.observablecollections.ObservableList;
import org.openmarkov.core.exception.InvalidStateException;
import org.openmarkov.core.inference.InferenceAlgorithm;
import org.openmarkov.core.model.network.EvidenceCase;
import org.openmarkov.core.model.network.Finding;
import org.openmarkov.core.model.network.NodeType;
import org.openmarkov.core.model.network.ProbNet;
import org.openmarkov.core.model.network.ProbNode;
import org.openmarkov.core.model.network.Util;
import org.openmarkov.core.model.network.Variable;
import org.openmarkov.core.model.network.potential.TablePotential;
import org.openmarkov.inference.variableElimination.VariableElimination;
import org.openmarkov.io.probmodel.PGMXReader;


public class ElviraView extends javax.swing.JFrame {
final private String bayesNetworkName = "Modulo";
private Object graph;
List<ProbNode> listPro = new ArrayList();
private ObservableList<ProbNode> listobservable=org.jdesktop.observablecollections.ObservableCollections.observableList(listPro);

    public ElviraView() {
        initComponents();
        setLocationRelativeTo(null);
    }

    public List<ProbNode> getListPro() {
        return listPro;
    }

    public void setListPro(List<ProbNode> listPro) {
        this.listPro = listPro;
    }

    public ObservableList<ProbNode> getListobservable() {
        return listobservable;
    }

    public void setListobservable(ObservableList<ProbNode> listobservable) {
        this.listobservable = listobservable;
    }

    public void iniciar() {
        try {

            // Open the file containing the network
            InputStream file = new FileInputStream(new File("Modulo.pgmx"));

            // Load the Bayesian network
            PGMXReader pgmxReader = new PGMXReader();
            ProbNet redPrueba = pgmxReader.loadProbNet(file, bayesNetworkName).getProbNet();

            listPro = redPrueba.getProbNodes();

            ///////////////////////

            EvidenceCase evidence = new EvidenceCase();
            InferenceAlgorithm variableElimination = new VariableElimination(redPrueba);
            variableElimination.setPreResolutionEvidence(evidence);
            // We are interested in the posterior probabilities of the diseases
            Variable paseModulo = redPrueba.getVariable("Pase_Modulo");
            ArrayList<Variable> variablesOfInterest = new ArrayList<Variable>();
            variablesOfInterest.add(paseModulo);

            // Compute the posterior probabilities
            HashMap<Variable, TablePotential> posteriorProbabilities =
                    variableElimination.getProbsAndUtilities();

            // Print the posterior probabilities on the standard output
            printResults(evidence, variablesOfInterest, posteriorProbabilities);
            
            String inte=String.valueOf(this.inteligencia.getSelectedItem());
            evidence.addFinding(redPrueba, "Inteligencia_Artificial", inte);
            String ante=String.valueOf(this.anteproyectos.getSelectedItem());
            evidence.addFinding(redPrueba, "Anteproyectos", ante);
            String control=String.valueOf(this.conAutomatico.getSelectedItem());
            evidence.addFinding(redPrueba, "Control_Automatizado", control);
            String eti=String.valueOf(this.etica.getSelectedItem());
            evidence.addFinding(redPrueba, "Etica", eti);
            String exper=String.valueOf(this.sisExpertos.getSelectedItem());
            evidence.addFinding(redPrueba, "Sistemas_Expertos", exper);
            String simu=String.valueOf(this.simulacion.getSelectedItem());
            evidence.addFinding(redPrueba, "Simulacion", simu);
            String asis=String.valueOf(this.asistencias.getSelectedItem());
            evidence.addFinding(redPrueba, "ASISTENCIAS", asis);



            posteriorProbabilities = variableElimination.getProbsAndUtilities(variablesOfInterest);
            printResults(evidence, variablesOfInterest, posteriorProbabilities);
            ////////////////////
        } catch (Exception e) {
            System.err.println(e.getMessage());
            e.printStackTrace();
        }
    }
        public void printResults(EvidenceCase evidence, ArrayList<Variable> variablesOfInterest,
            HashMap<Variable, TablePotential> posteriorProbabilities) {
        // Print the findings
        String evidencias= "Evidencias: \n";
        for (Finding finding : evidence.getFindings()) {
            evidencias=evidencias+finding.getVariable() + ": "+finding.getState()+"\n";
        }
        this.consola.setText(evidencias);
        
        for (Variable variable : variablesOfInterest) {
            double value;
            TablePotential posteriorProbabilitiesPotential = posteriorProbabilities.get(variable);
            int stateIndex = -1;
            try {
                stateIndex = variable.getStateIndex("si");
                value = posteriorProbabilitiesPotential.values[stateIndex];
                this.resultado.setText(Util.roundedString(value, "0.001"));
            } catch (InvalidStateException e) {
                e.printStackTrace();
            }
        }
    }
        //Metodo que devuelve la lista con todos los nodos
    @SuppressWarnings("empty-statement")
           public List<ProbNode> obtenerdatos(){
         List<ProbNode> listPro=null;
               try {
             InputStream file = new FileInputStream(new File("Modulo.pgmx"));
                   PGMXReader pgmxReader = new PGMXReader();
            ProbNet probNet = pgmxReader.loadProbNet(file, bayesNetworkName).getProbNet();
            graph=probNet.getPotentialsByType(NodeType.COST);
            System.out.println(probNet.getNumNodes());

          listPro = probNet.getProbNodes();
                  } catch (Exception e) {
            System.err.println(e.getMessage());
            e.printStackTrace();
        }
        return listPro;
           
   }
           
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

        inteligencia = new javax.swing.JComboBox();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        anteproyectos = new javax.swing.JComboBox();
        simulacion = new javax.swing.JComboBox();
        sisExpertos = new javax.swing.JComboBox();
        conAutomatico = new javax.swing.JComboBox();
        etica = new javax.swing.JComboBox();
        asistencias = new javax.swing.JComboBox();
        jLabel8 = new javax.swing.JLabel();
        resultado = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        consola = new javax.swing.JTextArea();
        jLabel9 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jLabel10 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        inteligencia.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        inteligencia.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "si", "no" }));
        inteligencia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                inteligenciaActionPerformed(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Tahoma", 2, 12)); // NOI18N
        jLabel1.setText("Inteligencia Artificial");

        jLabel2.setFont(new java.awt.Font("Tahoma", 2, 12)); // NOI18N
        jLabel2.setText("Anteproyectos");

        jLabel3.setFont(new java.awt.Font("Tahoma", 2, 12)); // NOI18N
        jLabel3.setText("Simulación");

        jLabel4.setFont(new java.awt.Font("Tahoma", 2, 12)); // NOI18N
        jLabel4.setText("Sistemas Expertos");

        jLabel5.setFont(new java.awt.Font("Tahoma", 2, 12)); // NOI18N
        jLabel5.setText("Control Automático");

        jLabel6.setFont(new java.awt.Font("Tahoma", 2, 12)); // NOI18N
        jLabel6.setText("Ética");

        jLabel7.setFont(new java.awt.Font("Tahoma", 2, 12)); // NOI18N
        jLabel7.setText("Asistencias");

        anteproyectos.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        anteproyectos.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "si", "no" }));
        anteproyectos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                anteproyectosActionPerformed(evt);
            }
        });

        simulacion.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        simulacion.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "si", "no" }));
        simulacion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                simulacionActionPerformed(evt);
            }
        });

        sisExpertos.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        sisExpertos.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "si", "no" }));
        sisExpertos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                sisExpertosActionPerformed(evt);
            }
        });

        conAutomatico.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        conAutomatico.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "si", "no" }));
        conAutomatico.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                conAutomaticoActionPerformed(evt);
            }
        });

        etica.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        etica.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "si", "no" }));
        etica.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                eticaActionPerformed(evt);
            }
        });

        asistencias.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        asistencias.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "si", "no" }));
        asistencias.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                asistenciasActionPerformed(evt);
            }
        });

        jLabel8.setFont(new java.awt.Font("Traditional Arabic", 0, 18)); // NOI18N
        jLabel8.setText("Datos:");

        resultado.setFont(new java.awt.Font("Tahoma", 3, 24)); // NOI18N
        resultado.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        resultado.setText("0.0");

        jButton1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        jButton1.setText("Ver");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        consola.setColumns(20);
        consola.setRows(5);
        jScrollPane1.setViewportView(consola);

        jLabel9.setFont(new java.awt.Font("Traditional Arabic", 0, 18)); // NOI18N
        jLabel9.setText("Evidencias");

        org.jdesktop.beansbinding.ELProperty eLProperty = org.jdesktop.beansbinding.ELProperty.create("${listobservable}");
        org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, eLProperty, jTable1);
        org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${approximateMaximumUtilityFunction}"));
        columnBinding.setColumnName("Approximate Maximum Utility Function");
        columnBinding.setColumnClass(Double.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${approximateMinimumUtilityFunction}"));
        columnBinding.setColumnName("Approximate Minimum Utility Function");
        columnBinding.setColumnClass(Double.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${name}"));
        columnBinding.setColumnName("Name");
        columnBinding.setColumnClass(String.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${probNet}"));
        columnBinding.setColumnName("Prob Net");
        columnBinding.setColumnClass(org.openmarkov.core.model.network.ProbNet.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${utilityFunction}"));
        columnBinding.setColumnName("Utility Function");
        columnBinding.setColumnClass(org.openmarkov.core.model.network.potential.TablePotential.class);
        bindingGroup.addBinding(jTableBinding);
        jTableBinding.bind();org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${listPro}"), jTable1, org.jdesktop.beansbinding.BeanProperty.create("selectedElement"));
        bindingGroup.addBinding(binding);

        jScrollPane2.setViewportView(jTable1);

        jLabel10.setFont(new java.awt.Font("Traditional Arabic", 0, 18)); // NOI18N
        jLabel10.setText("Probabilidad de aprobar");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(32, 32, 32)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(asistencias, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(etica, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(inteligencia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(conAutomatico, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(sisExpertos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(anteproyectos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(simulacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(58, 58, 58)
                        .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(2, 2, 2)
                        .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 210, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(resultado, javax.swing.GroupLayout.PREFERRED_SIZE, 192, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(184, 184, 184))
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 753, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(352, 352, 352)
                        .addComponent(jLabel8)))
                .addContainerGap(24, Short.MAX_VALUE))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                    .addContainerGap(413, Short.MAX_VALUE)
                    .addComponent(jLabel10)
                    .addGap(217, 217, 217)))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(inteligencia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2)
                            .addComponent(anteproyectos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(simulacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(sisExpertos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton1))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel5)
                            .addComponent(conAutomatico, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(12, 12, 12)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel6)
                            .addComponent(etica, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(21, 21, 21)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel7)
                            .addComponent(asistencias, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(45, 45, 45)
                        .addComponent(resultado)))
                .addGap(3, 3, 3)
                .addComponent(jLabel8)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 281, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(37, Short.MAX_VALUE))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(227, 227, 227)
                    .addComponent(jLabel10)
                    .addContainerGap(379, Short.MAX_VALUE)))
        );

        bindingGroup.bind();

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void inteligenciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_inteligenciaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_inteligenciaActionPerformed

    private void anteproyectosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_anteproyectosActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_anteproyectosActionPerformed

    private void simulacionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_simulacionActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_simulacionActionPerformed

    private void sisExpertosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sisExpertosActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_sisExpertosActionPerformed

    private void conAutomaticoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_conAutomaticoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_conAutomaticoActionPerformed

    private void eticaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_eticaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_eticaActionPerformed

    private void asistenciasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_asistenciasActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_asistenciasActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        iniciar();
         listobservable.clear();
       listobservable.addAll(obtenerdatos());
      
       jTable1.updateUI();
    }//GEN-LAST:event_jButton1ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(ElviraView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(ElviraView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(ElviraView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(ElviraView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new ElviraView().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox anteproyectos;
    private javax.swing.JComboBox asistencias;
    private javax.swing.JComboBox conAutomatico;
    private javax.swing.JTextArea consola;
    private javax.swing.JComboBox etica;
    private javax.swing.JComboBox inteligencia;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTable jTable1;
    private javax.swing.JLabel resultado;
    private javax.swing.JComboBox simulacion;
    private javax.swing.JComboBox sisExpertos;
    private org.jdesktop.beansbinding.BindingGroup bindingGroup;
    // End of variables declaration//GEN-END:variables
}
